package models.mappers;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import models.InviteReward;

public interface InviteRewardMapper {
	@Select("select * from invate_reward where userid=#{id}")
	InviteReward selectRewardByUserId(long id);
	@Update("update invate_reward set hasrecive=#{hasrecive},"
			+ "allcount=#{allcount}")
	void saveRecive(InviteReward reward);
	/**
	 * 更新买手数量
	 * @param reward
	 */
	@Update("update invate_reward set buyercount=#{buyercount} where userid=#{userid}")
	void updateReWard(InviteReward reward);
	/**
	 * 保存记录
	 * @param reward
	 */
	@Insert("insert into invate_reward(userid,allcount,buyercount) values (#{userid},#{allcount},#{buyercount})")
	void saveReWard(InviteReward reward);
	
}
